package com.qf.servlet; /**
 * @author lixu
 */

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

/**
 * Maven的JavaEE测试
 */
//@WebServlet(urlPatterns = "",name = "HelloServlet", value = "/HelloServlet")
//@WebServlet(urlPatterns = "/hello")
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {


    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        System.out.println("==我们进入了HelloServlet");
        //内部转发
        request.getRequestDispatcher("/WEB-INF/jsp/hello.jsp").forward(request,response);

    }
}
